<template>
    <div class="form-demo">
        <router-view></router-view>
    </div>
</template>

<script>
import { applicationInfo } from "@/request/api"
export default {
    mounted() {
        this.addMatchesInfo();
    },
    methods: {
        addMatchesInfo() {
            applicationInfo().then(res => {
                console.log(res);
                if (res.data.resultCode === '200') {
                    this.$store.commit('setBacteria', {})
                    this.$store.commit('setRoutine', {})
                    this.$store.commit('setProtein', {})
                    res.data.data.length > 0 && res.data.data.forEach(item => {
                        if (item.matchId === '1') {
                            this.$store.commit('setBacteria', item)
                        } else if (item.matchId === '2') {
                            this.$store.commit('setRoutine', item)
                        } else if (item.matchId === '3') {
                            this.$store.commit('setProtein', item)
                        }
                    });
                }
            })
        }
    }
}
</script>

<style lang="less" scoped>
.form-demo {
    width: 34.99rem;
    margin: 0 auto;
}
</style>